<template>
  <div>
    <el-card>
      <el-row>
        <el-col :span="6">
          <el-input placeholder="请输入内容"></el-input>
        </el-col>
        <el-col :span="2">
          <el-button type="primary" icon="el-icon-search" style="padding:10px; width:120px; margin-left:10px" plain>检索</el-button>
        </el-col>
        <el-col :span="16"></el-col>
      </el-row>
    <el-table style="margin-top:10px" :data="tableData" :row-cell-style="dataRowStyle" :header-cell-style="tableHeader" border>
      <el-table-column prop="date" label="日期"></el-table-column>
      <el-table-column prop="name" label="姓名"></el-table-column>
      <el-table-column prop="province" label="省份" ></el-table-column>
      <el-table-column prop="city" label="市区"></el-table-column>
      <el-table-column prop="address" label="地址"></el-table-column>
      <el-table-column prop="zip" label="邮编"></el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
          <el-button type="text" size="small">编辑</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- <el-row>
      <el-col></el-col>
      <el-col>
    </el-row> -->
     <el-pagination style="text-align:right; margin-top:10px"
    layout="prev, pager, next"
    :total="1000">
  </el-pagination>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1518 弄",
          zip: 200333
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1517 弄",
          zip: 200333
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1519 弄",
          zip: 200333
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1516 弄",
          zip: 200333
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1516 弄",
          zip: 200333
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1516 弄",
          zip: 200333
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1516 弄",
          zip: 200333
        }
      ]
    };
  },
  methods:{
    tableHeader({row,column,rowIndex,columnIndex}) {
      return 'background-color:gray; color:white; height:10px';
    },
    dataRowStyle({row,rowIndex}) {
      return 'height:10px;';
    },
     handleClick: function(row) {
      console.log(row);
      this.$router.push({path:'/users/detail'});
    }
  }
};
</script>

<style scope>

.el-table__body tr,
  .el-table__body td {
    padding: 0;
    height: 37px;
}
</style>